<?php
	$con = mysqli_connect('localhost','root','','friday');//创建的mysqli对象,又叫句柄
	mysqli_set_charset($con, 'utf8');
	//查询语句
	$sql = "select * from goods";
	$result = mysqli_query($con, $sql);
	$arr = mysqli_fetch_all($result,MYSQLI_ASSOC);
	echo json_encode($arr);
	//关闭数据链接
	mysqli_close($con);
	?>